﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Mathmall.Administration.Migrations
{
    /// <inheritdoc />
    public partial class ChangeMenuTableFieldsToNvarchar : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Operation",
                table: "Menu",
                type: "nvarchar(256)",
                nullable: true,
                comment: "操作",
                oldClrType: typeof(string),
                oldType: "varchar(256)",
                oldNullable: true,
                oldComment: "操作");

            migrationBuilder.AlterColumn<string>(
                name: "NodeType",
                table: "Menu",
                type: "nvarchar(256)",
                nullable: true,
                comment: "节点类型",
                oldClrType: typeof(string),
                oldType: "varchar(256)",
                oldNullable: true,
                oldComment: "节点类型");

            migrationBuilder.AlterColumn<string>(
                name: "MenuName",
                table: "Menu",
                type: "nvarchar(256)",
                nullable: false,
                comment: "菜单名称",
                oldClrType: typeof(string),
                oldType: "varchar(256)",
                oldComment: "菜单名称");

            migrationBuilder.AlterColumn<string>(
                name: "AuthorityValue",
                table: "Menu",
                type: "nvarchar(256)",
                nullable: true,
                comment: "权限值",
                oldClrType: typeof(string),
                oldType: "varchar(256)",
                oldNullable: true,
                oldComment: "权限值");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "Operation",
                table: "Menu",
                type: "varchar(256)",
                nullable: true,
                comment: "操作",
                oldClrType: typeof(string),
                oldType: "nvarchar(256)",
                oldNullable: true,
                oldComment: "操作");

            migrationBuilder.AlterColumn<string>(
                name: "NodeType",
                table: "Menu",
                type: "varchar(256)",
                nullable: true,
                comment: "节点类型",
                oldClrType: typeof(string),
                oldType: "nvarchar(256)",
                oldNullable: true,
                oldComment: "节点类型");

            migrationBuilder.AlterColumn<string>(
                name: "MenuName",
                table: "Menu",
                type: "varchar(256)",
                nullable: false,
                comment: "菜单名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(256)",
                oldComment: "菜单名称");

            migrationBuilder.AlterColumn<string>(
                name: "AuthorityValue",
                table: "Menu",
                type: "varchar(256)",
                nullable: true,
                comment: "权限值",
                oldClrType: typeof(string),
                oldType: "nvarchar(256)",
                oldNullable: true,
                oldComment: "权限值");
        }
    }
}
